<?php
include 'contactsImporter.php';

define('_ENGINE', TRUE);
define('DS', DIRECTORY_SEPARATOR);

defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
defined('APPLICATION_PATH_TMP') || define('APPLICATION_PATH_TMP', APPLICATION_PATH . DS . 'temporary');

if(empty($_POST)) {
  exit;
}

// get general config
if( !@file_exists(APPLICATION_PATH_TMP . DS . 'fi_settings_cache.php') ) {
  exit;
}

$config = include APPLICATION_PATH_TMP . DS . 'fi_settings_cache.php';

$importer = new ContactsImporter($config['api_key'], $config['secret']);

$sig = $importer->sign($_POST);

echo $sig;

?>